<template>
<div>
   <!-- 上方搜索栏 -->
    <div class="ty_search">
      <el-form :inline="true" :model="formInline" label-width="90px">
        <el-form-item label="备案类别" size="mini">
          <el-input
            v-model="formInline.user"
            placeholder="请输入企业法人"
          ></el-input>
        </el-form-item>
        <el-form-item label="单位名称" size="mini">
          <el-input
            v-model="formInline.user"
            placeholder="请输入企业名称"
          ></el-input>
        </el-form-item>
        <el-form-item label="个人姓名" size="mini">
          <el-input
            v-model="formInline.user"
            placeholder="请输入手机号"
          ></el-input>
        </el-form-item>
        <el-form-item label="创建人" size="mini">
          <el-input
            v-model="formInline.user"
            placeholder="请输入手机号"
          ></el-input>
        </el-form-item>
        <el-form-item label="单位负责人" size="mini">
          <el-input
            v-model="formInline.user"
            placeholder="请输入手机号"
          ></el-input>
        </el-form-item>
        <el-form-item label="状态" size="mini">
          <el-select v-model="formInline.TYPE" placeholder="请选择状态">
            <el-option label="待审批" value="7"></el-option>
            <el-option label="已备案" value="8"></el-option>
            <el-option label="已注销" value="9"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="创建时间" size="mini">
          <el-input
            v-model="formInline.user"
            placeholder="请输入手机号"
          ></el-input>
        </el-form-item>
        <el-form-item label="完成时间" size="mini">
          <el-input
            v-model="formInline.user"
            placeholder="请输入手机号"
          ></el-input>
        </el-form-item>
        <el-form-item size="mini">
          <el-button type="primary" @click="onSubmit(formInline)"
            >查询</el-button
          >
          <el-button @click="cancel">清空</el-button>
        </el-form-item>
      </el-form>
    </div>
 <el-card >
   
    <!-- 表格上方按钮 -->
    <div style="margin-bottom: 10px">
      <el-button type="primary" size="mini" @click="add">新增备案申请</el-button>
    </div>
    <el-table
      border
      ref="multipleTable"
      :data="tableData"
      style="width: 100%"
      height="40vh"
    >
      <el-table-column prop="NAME" label="备案编号"></el-table-column>
      <el-table-column prop="NAME" label="单位名称"></el-table-column>
      <el-table-column prop="NAME" label="备案类别"></el-table-column>
      <el-table-column prop="NAME" label="个人姓名"></el-table-column>
      <el-table-column prop="NAME" label="单位负责人"></el-table-column>
      <el-table-column prop="NAME" label="备案时间"></el-table-column>
      <el-table-column prop="NAME" label="状态"></el-table-column>
      <el-table-column prop="NAME" label="创建人"></el-table-column>
      <el-table-column prop="NAME" label="创建时间"></el-table-column>
      <el-table-column fixed="right" label="操作" width="200">
        <template slot-scope="scope">
          <el-button type="text" size="small">查看</el-button>
          <el-button type="text" size="small">编辑</el-button>
          <el-button type="text" size="small">更新</el-button>
          <el-button type="text" size="small">注销</el-button>
          <el-button type="text" size="small">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <MyPagination
      :pagination="pagination"
      @current-change="pageChange"
      @size-change="sizeChange"
    ></MyPagination>

    <Form ref="form" />
  </el-card>
</div>
 
</template>
<script>
import MyPagination from "@/components/common/pagination.vue";
import Form from "./form.vue";
export default {
  components: {
    MyPagination,
    Form,
  },
  data() {
    return {
      tableData: [
        {
          NAME: "测试数据",
        },
      ],
      pagination: {
        limit: 20,
        page: 1,
        total: 100,
      },
      formInline: {
        user: "",
        TYPE: "",
        TYPE2: "",
      },
    };
  },
  created() {
    // this.onSubmit(this.formInline);
  },
  methods: {
    add() {
      this.$refs.form.isShow();
    },
    onSubmit(formInline) {
      plstutatuscfApproveInfo({
        page: this.pagination.page,
        limit: this.pagination.limit,
        TYPE: this.formInline.TYPE,
        search: this.formInline.user,
      }).then((res) => {
        this.tableData = res.body;
      });
    },
    cancel() {
      // this.searchData.BUILDING_ID = "";
      // this.searchData.FLOOR_ID = "";
      // this.searchData.NAME = "";
      // this.get_list();
    },
    pageChange(val) {
      this.pagination.page = val;
      this.onSubmit(this.formInline);
    },
    sizeChange(val) {
      this.pagination.limit = val;
      this.onSubmit(this.formInline);
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .el-card__body {
  height: 100%;

  width: 100%;
}
</style>
